<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title></title>
	<include file="Public/header" />
</head>
<body>
<script type="text/javascript">
	var productorderEditUrl="{:U('Product/productorderSave')}";//更新数据
	var getproductorderUrl="{:U('Product/get_productorder')}";
	var productorderDelUrl="{:U('Product/productorderDel')}";
	var productorderExamineUrl="{:U('Product/examineproductorder')}";
	var productorderClearUrl="{:U('Product/productorderClear')}";
	var productorderUndoUrl="{:U('Product/productorderUndo')}";
	var productorderInfoUrl="{:U('Product/productorderInfo')}";
	var byproductorderUrl="{:U('Product/byproductorder')}";//副产品
	var erpId="{:I('id')}";//erp企业对应id
	var product_ordernoUrl="{:U('Product/ajax_orderno')}";//动态获取流水单号
	var product_batchnoUrl="{:U('Product/ajax_batchno')}";//动态获取批次号
	var product_goodsnoUrl="{:U('Product/ajax_goodsno')}";//动态获取产品编码
	var product_sourcenoUrl="{:U('Product/ajax_sourceno')}";//动态获取产品料号
	
	var section_lists={$section_lists};
	var unit_lists={$unit_lists};
	var personnel_lists={$personnel_lists};
	var warehouse_lists={$warehouse_lists};
	
	var productinboundUrl="{:U('Product/product_inbound')}";//成品入库
	var productprintUrl="{:U('Product/printproduct')}";//打印
	var pushOrderUrl="{:U('Pushsendapi/productorderOrderSend')}";//推送接口
	<!-- using('../../../default/js/productorder.js'); -->
</script>
<script type="text/javascript" src="__PUBLIC__/default/js/productorder.js"></script>

	<table id="productorderDatagrid" toolbar="#productorder_tb"></table>
	
	<!-- 添加 -->
	<div id="productorderAddDialog" class="easyui-dialog" title="添加" style="width:500px;padding:10px 20px"
        closed="true" buttons="#productorderAddButtons"  modal="true">
         <form id="productorderAddForm" method="post" novalidate>
			<div class="fitem">
                <label>计划单编号</label>
                <input name="purchasing_no" id="productorder_purchasing_no" class="easyui-textbox" data-options="readonly:true,height:30" />
            </div>
            <div class="fitem">
                <label>申请部门</label>
				<select class="easyui-combobox" name="section_no" id="product_section_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[1,30]','selected[]']">
                    <option value="0">未选择</option>
					<volist name="section_list" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select> 
			</div>
			<div class="fitem">
                <label>产品名称</label>
                <input name="pro_name" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>

			<div class="fitem">
                <label>产品规格</label>
                <input name="pro_spec" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>料号</label>
                <input name="source_no" id="productorder_source_no" type="text"  class="easyui-textbox" data-options="readonly:true,required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>产品编码</label>
                <input name="pro_no" type="text" id="productorder_goods_no" class="easyui-textbox" data-options="readonly:true,height:30" />
            </div>
			<div class="fitem">
                <label>计划数量</label>
                <input name="pro_num_plan" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>主单位</label>
                 <select class="easyui-combobox" name="unit1" id="product_order_unit1" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'200',validType:['length[1,30]','selected[]']">
                    <option value="0">未选择</option>
					<volist name="unit_list" id="vo">
                        <option value="{$vo['unit_no']}">{$vo['unit_name']}</option>
                    </volist>
                </select>
            </div>
			<div class="fitem">
                <label>批次</label>
                <input name="batch_no" id="productorder_batch_no" type="text"  class="easyui-textbox" data-options="readonly:true,height:30" />
            </div>
			<div class="fitem">
                <label>制单人</label>
                <select class="easyui-combobox" name="people_make_no" id="product_people_make_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[1,30]','selected[]']">
                    <option value="0">未选择</option>
					<volist name="personnel_list" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select> 
            </div>
			<div class="fitem">
                <label>申请人</label>
                <select class="easyui-combobox" name="people_purchasing_no" id="product_people_purchasing_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[1,30]','selected[]']">
					<option value="0">未选择</option>
					<volist name="personnel_list" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select>  
            </div>
			<div class="fitem">
                <label>生产周期要求</label>
                <input name="product_weeks"  type="text"  class="easyui-textbox" data-options="height:70,multiline:true,width:300" />
            </div>
			<div class="fitem">
                <label>申请摘要</label>
                <input name="product_marks" type="text"  class="easyui-textbox" data-options="height:70,multiline:true,width:300" />
            </div>
			<div class="fitem">
                <label>入库仓库</label>
                <select class="easyui-combobox" name="inbound_warehouse_code" id="product_order_inbound_warehouse_code" style="width:170px;height:30px;" data-options="required:true,editable:false,panelHeight:'200',validType:['length[1,30]','selected[]']">
                    <volist name="depotlist" id="vo">
                        <option value="{$vo['code']}">{$vo['name']}</option>
                    </volist>
                </select>   
            </div>
			<div class="fitem">
                <label>备注</label>
                <input name="mark" type="text"  class="easyui-textbox" data-options="height:30" />
            </div>
         </form>
    </div>
    <div id="productorderAddButtons">
    	<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="productorderObj.add('{:U('Product/productorderAdd')}')" style="width:90px">添加</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#productorderAddDialog').dialog('close')" style="width:90px">取消</a>
    </div>
    <!-- /添加 -->
	<!-- 编辑 -->
    <div id="productorderEditDialog" class="easyui-dialog" style="width:400px;padding:10px 20px"
            closed="true" buttons="#productorderEditButtons"  modal="true">
        <form id="productorderEditForm" method="post" novalidate>          
            <div class="fitem">
                <label>生产计划单编号</label>
				<input name="id"  type="hidden" />
                <input name="purchasing_no" class="easyui-textbox" data-options="readonly:true,height:30" />
            </div>
            <div class="fitem">
                <label>申请部门</label>
				<select class="easyui-combobox" name="section_no" id="product_section_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[1,30]','selected[]']">
                    <option value="0">未选择</option>
					<volist name="section_list" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select> 
			</div>
			<div class="fitem">
                <label>产品名称</label>
                <input name="pro_name" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>产品规格</label>
                <input name="pro_spec" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>料号</label>
                <input name="source_no" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>产品编码</label>
                <input name="pro_no" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,50]']" />
            </div>
			<div class="fitem">
                <label>计划数量</label>
                <input name="pro_num_plan" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>主单位</label>
                 <select class="easyui-combobox" name="unit1" id="product_order_unit1" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'200',validType:['length[1,30]','selected[]']">
                    <option value="0">未选择</option>
					<volist name="unit_list" id="vo">
                        <option value="{$vo['unit_no']}">{$vo['unit_name']}</option>
                    </volist>
                </select>
            </div>
			<div class="fitem">
                <label>批次</label>
                <input name="batch_no" type="text"  class="easyui-textbox" data-options="readonly:true,height:30" />
            </div>
			<div class="fitem">
                <label>制单人</label>
                <select class="easyui-combobox" name="people_make_no" id="product_people_make_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[1,30]','selected[]']">
                    <option value="0">未选择</option>
					<volist name="personnel_list" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select> 
            </div>
			<div class="fitem">
                <label>申请人</label>
                <select class="easyui-combobox" name="people_purchasing_no" id="product_people_purchasing_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[1,30]','selected[]']">
                    <option value="0">未选择</option>
					<volist name="personnel_list" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select>  
            </div>
			<div class="fitem">
                <label>生产周期要求</label>
                <input name="product_weeks"  type="text"  class="easyui-textbox" data-options="height:30" />
            </div>
			<div class="fitem">
                <label>申请摘要</label>
                <input name="product_marks" type="text"  class="easyui-textbox" data-options="height:30" />
            </div>
			<div class="fitem">
                <label>入库仓库</label>
                <select class="easyui-combobox" name="inbound_warehouse_code"  style="width:170px;height:30px;" data-options="required:true,editable:false,panelHeight:'200',validType:['length[1,30]','selected[]']">
                    <volist name="depotlist" id="vo">
                        <option value="{$vo['code']}">{$vo['name']}</option>
                    </volist>
                </select>   
            </div>
			<div class="fitem">
                <label>备注</label>
                <input name="mark" type="text"  class="easyui-textbox" data-options="height:30" />
            </div>
        </form>
    </div>
    <div id="productorderEditButtons">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="productorderObj.save('{:U('Product/productorderSave')}')" style="width:90px">更新</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:
    $('#productorderEditDialog').dialog('close')" style="width:90px">取消</a>
    </div>
    <!-- /编辑 -->
	<!-- 编辑生产完成数量 -->
    <div id="productorderNumsEditDialog" class="easyui-dialog" style="width:400px;padding:10px 20px"
            closed="true" buttons="#productorderNumsEditButtons"  modal="true">
        <form id="productorderNumsEditForm" method="post" novalidate>          
            <div class="fitem">
                <label>生产计划单编号</label>
				<input name="id"  type="hidden" />
                <input name="purchasing_no" class="easyui-textbox" data-options="readonly:true,height:30" />
            </div>
			<div class="fitem">
                <label>完成数量</label>
                <input name="pro_num" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>

        </form>
    </div>
    <div id="productorderNumsEditButtons">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="productorderObj.saveNums('{:U('Product/productorderNumsSave')}')" style="width:90px">更新</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:
    $('#productorderNumsEditDialog').dialog('close')" style="width:90px">取消</a>
    </div>
    <!-- /编辑生产完成数量 -->
    <!-- 搜索栏 -->
    <div id="productorder_tb">
        <form id="productorderSearchForm" method="post" novalidate>
             <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon icon-all" plain="true" onclick="productorderObj.showAll()">全部</a>     
			 生产计划单编号:<input class="easyui-textbox" name="purchasing_no" style="width:150px;height:30px;">
			<a href="#" class="easyui-linkbutton searchBar" iconCls="icon-search" style="height:30px;">搜索</a>
        </form>
		<a href="javascript:void(0)" onclick="productorderObj.infoBar()" class="easyui-linkbutton" data-options="iconCls:'icon-information',plain:true">详情</a>
		<!-- <a href="javascript:void(0)" onclick="productorderObj.infobyBar()" class="easyui-linkbutton" data-options="iconCls:'icon-information',plain:true">副产品</a> -->
		<!-- <a href="javascript:void(0)" onclick="productorderObj.inboundBar()" class="easyui-linkbutton" data-options="iconCls:'icon-door_in',plain:true">入库</a> -->
		<!-- <a href="javascript:void(0)" onclick="productorderObj.editNumsBar()" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改完成数量</a> -->
		<a href="javascript:void(0)" onclick="productorderObj.addBar()" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">添加</a>
        <a href="javascript:void(0)" onclick="productorderObj.editBar()" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</a>
        <a href="javascript:void(0)" onclick="productorderObj.removeBar()" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true">删除</a>
		<a href="javascript:void(0)" onclick="productorderObj.reloadBar()" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true">刷新</a>
		<a href="javascript:void(0)" onclick="productorderObj.saveBar()" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true">保存</a>
        <a href="javascript:void(0)" onclick="productorderObj.examineBar(1)" class="easyui-linkbutton" data-options="iconCls:'icon-key',plain:true">审核通过</a>
		<a href="javascript:void(0)" onclick="productorderObj.examineBar(2)" class="easyui-linkbutton" data-options="iconCls:'icon-key_delete',plain:true">审核不通过</a>
		<a href="javascript:void(0)" class="easyui-menubutton" data-options="menu:'#product_order_mm1',iconCls:'icon-recycle'">回收站</a>
		<a href="javascript:void(0)" onclick="productorderObj.printBar(1)" class="easyui-linkbutton" data-options="iconCls:'icon-information',plain:true">打印</a>
		<!-- <a href="javascript:void(0)" onclick="productorderObj.printBar(2)" class="easyui-linkbutton" data-options="iconCls:'icon-information',plain:true">领料单</a> -->
		<!-- <a href="javascript:void(0)" onclick="productorderObj.printBar(3)" class="easyui-linkbutton" data-options="iconCls:'icon-information',plain:true">转换单</a> -->
		<div id="product_order_mm1" style="width:150px;">
			<div onclick="productorderObj.recycle()">查看</div>
			<div onclick="productorderObj.undoBar()" data-options="iconCls:'icon-undo'">恢复</div>
			<div onclick="productorderObj.clearBar()" data-options="iconCls:'icon-remove'">删除</div>
		</div>
    </div>
    <!-- /搜索栏 -->
</body>